$(document).ready(function() {
    $(".alert_btn").on('click',function() {
        $(".wx-tips").show();
        chainMask.show();
        $("#iamloading__box").on('click',function() {
            chainMask.hide();
            $(".wx-tips").hide();
        });
    });
});
var chainMask = {   //遮罩
    show: function() {      
        if($("#iamloading__box").attr("data-load") == undefined){
            $("body").append('<div id="iamloading__box" data-load="load">'+
                                '<style type="text/css">'+
                                    '#iamloading__box{position: fixed; z-index: 999; background:rgba(0,0,0,0.5); width: 100%; top: 0; left: 0;}'+
                                '</style>'+
                            '</div>');
        }
        var boxObj = $("#iamloading__box"),centerObj = $("#iamloading__box_center");
        boxObj.height($(window).height());
        boxObj.css("display","block");
    },      
    hide: function() { $("#iamloading__box").fadeOut(400); }
};

var shareurl = 'http://mp.weixin.qq.com/s?__biz=MzA5NjEwNjkxNA==&mid=205386393&idx=1&sn=c635574539c4e725bd08ca28fcf3262c#rd';
var imgUrl = 'http://xmhy.nidjia.com/public/images/logo.jpg';
var title = "点击关注【闽南美的空调】公众账号，进入领取红包";
var content = '美的&腾讯大闽网首届空调节，空调只要2999元； 点击右上方“闽南美的空调”关注，进入公众号抢美的现金红包，可不要手软哦！';
//window.shareData = {
//    "imgUrl" : imgUrl,
//    "timeLineLink" : shareurl,
//    "sendFriendLink" : shareurl,
//    "weiboLink" : shareurl,
//    "tTitle" : "全民游戏赢大奖",
//    "tContent" : '你以为我会告诉你，怎样轻松拿到安利送你的蛋白粉 、沐浴露、握力器、运动小腰包吗？猛点，自己看！',
//    "fTitle" : "全民游戏赢大奖",
//    "fContent" : '你以为我会告诉你，怎样轻松拿到安利送你的蛋白粉 、沐浴露、握力器、运动小腰包吗？猛点，自己看！',
//    "wContent" : '你以为我会告诉你，怎样轻松拿到安利送你的蛋白粉 、沐浴露、握力器、运动小腰包吗？猛点，自己看！'
//};

wx.ready(function () {
    wx.onMenuShareAppMessage({
        title: title,
        desc:  content,
        link:  shareurl,
        imgUrl: imgUrl,
        trigger: function (res) {},
        success: function (res) {},
        cancel: function (res) {},
        fail: function (res) {}
    });
    wx.onMenuShareTimeline({
        title: title,
        link: shareurl,
        imgUrl: imgUrl,
        trigger: function (res) {},
        success: function (res) {},
        cancel: function (res) {},
        fail: function (res) {}
    });
    wx.onMenuShareQQ({
        title: title,
        desc:  content,
        link:  shareurl,
        imgUrl: imgUrl,
        trigger: function (res) {},
        success: function (res) {},
        cancel: function (res) {},
        fail: function (res) {}
    });
    wx.onMenuShareWeibo({
        title: title,
        desc:  content,
        link:  shareurl,
        imgUrl: imgUrl,
        trigger: function (res) {},
        success: function (res) {},
        cancel: function (res) {},
        fail: function (res) {}
    });
});
